package com.shqcjd.preinstallmobile.ui.activity.preview;

import android.view.View;
import android.webkit.WebView;
import android.widget.ImageButton;
import android.widget.TextView;


import com.shqcjd.preinstallmobile.R;
import com.shqcjd.preinstallmobile.ui.base.BaseActivity;
import com.shqcjd.preinstallmobile.ui.base.BasePresenter;

import butterknife.BindView;

public class TXTActivity extends BaseActivity {


    @BindView(R.id.ib_back)
    ImageButton ib_back;
    @BindView(R.id.tv_toolbar_center)
    TextView tvToolbarCenter;
    @BindView(R.id.wv_txt)
    WebView wvTxt;

    private String url;//文件url
    private String name;//文件名称

    @Override
    protected BasePresenter createPresenter() {
        return null;
    }

    @Override
    protected int provideContentViewId() {
        return R.layout.activity_txt;
    }

    @Override
    public void init() {
        super.init();
        url = getIntent().getStringExtra("url");
        name = getIntent().getStringExtra("name");
    }

    @Override
    public void initView() {
        super.initView();
        tvToolbarCenter.setText(name);
        wvTxt.loadUrl(url);
        ib_back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
    }
}
